package com.qding.park.manager.service.statis.biz;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Component;

import com.qding.park.common.utils.DateUtils;
import com.qding.park.manager.pojo.TbCarlock;
import com.qding.park.manager.pojo.enums.CarLockStatusEnum;

@Component("carLockStatisBiz_statis")
public class CarLockStatisBiz {
	
	
	private static final Log _log = LogFactory.getLog(CarLockStatisBiz.class);
	
	
	public String  getOrderStatusStr(TbCarlock carLock){
		
		String temp="";
		
//		if(CarLockStatusEnum.EFFECT_STATUS.getStatus()==carLock.getStatus()){
//			//生效状态
			temp=DateUtils.formatDate(carLock.getCreate_date(), DateUtils.DATE_FORMAT_DATETIME)+" 成功";
//		}else {
//			temp=DateUtils.formatDate(carLock.getCreate_date(), DateUtils.DATE_FORMAT_DATETIME)+" 失败";
//		}
		
		return temp;
		
	}
	
	public String  getCurrentStatus(TbCarlock carLock){
		String temp="";
		
		if(CarLockStatusEnum.CANCEL_STATUS.getStatus()==carLock.getStatus()){
			temp=DateUtils.formatDate(carLock.getUpdate_date(), DateUtils.DATE_FORMAT_DATETIME)+" 手动解锁";
		}else if(CarLockStatusEnum.EFFECT_STATUS.getStatus()==carLock.getStatus()){
			temp="已锁定";
		}else if(CarLockStatusEnum.OVERTIME_STATUS.getStatus()==carLock.getStatus()){
			temp=DateUtils.formatDate(carLock.getUpdate_date(), DateUtils.DATE_FORMAT_DATETIME)+" 自动解锁";
		}else if(CarLockStatusEnum.DEL_STATUS.getStatus()==carLock.getStatus()){
			temp="用户端删除";
		}else{
			temp="测试状态";
		}
		return temp;
		
	}
	
}
